// 云函数入口文件
const cloud = require('wx-server-sdk')

cloud.init()

// 云函数入口函数
exports.main = async (event, context) => {
  if(event.action=="clear") {
    console.log(event);
    const db = cloud.database();
    let userCollect = db.collection(event.database);
    let res = await userCollect.where({
      "_openid":event.userInfo.openId
    }).remove();
    return{
      result:res
    }
  }
}